'use strict';

// 机构
const ORG_MAP = {
  10000: '汇付天下',
  10001: '汇来米',
  10002: '收钱吧',
  10003: '连连支付',
};

// 媒体行业
const INDUSTRY_MAP = {
  BUSINESS_OFFICE: '商务办公',
  SYSTEM_TOOL: '系统工具',
  TOOLS_LIFE: '生活工具',
  MOBILE_SHOPPING: '移动购物',
  HEALTH_CARE: '健康医疗',
  EDUCATION_TRAINING: '教育培训',
  CAR_SERVICES: '汽车服务',
  FINANCE: '财经金融',
  TRAVEL: '出行旅游',
  MOBILE_MUSIC: '移动音乐',
  MOBILE_VIDEO: '移动视频',
  MOBILE_COMMUNITY: '移动社区',
  MOBILE_GAME: '手机游戏',
  DIGITAL_READING: '数字阅读',
  PARENTING: '育儿母婴',
  NEWS: '新闻资讯',
  PICTURE_SERVICE: '图片服务',
  PHYSICAL_EDUCATION: '体育',
  DOMESTIC_SERVICES: '生活服务',
};

const RECEIVER_LIST = [
  {
    receiverId: 4,
    receiverName: '广点通',
  },
  {
    receiverId: 7,
    receiverName: '亿典',
  },
  {
    receiverId: 8,
    receiverName: '快手',
  },
  {
    receiverId: 9,
    receiverName: '软告',
  },
  {
    receiverId: 10,
    receiverName: '融易推',
  },
  {
    receiverId: 11,
    receiverName: '芒果',
  },
  {
    receiverId: 12,
    receiverName: '天卓',
  },
  {
    receiverId: 13,
    receiverName: '快友',
  },
  {
    receiverId: 14,
    receiverName: '穿山甲',
  },
  {
    receiverId: 15,
    receiverName: '一点',
  },
  {
    receiverId: 16,
    receiverName: '广推',
  },
  {
    receiverId: 25,
    receiverName: '芒果互动',
  },
  {
    receiverId: 26,
    receiverName: '饿了么',
  },
  {
    receiverId: 44,
    receiverName: '趣头条',
  },
];

const map2List = (map, valueField = 'value', labelField = 'label') => {
  if (!map) return [];
  const list = [];
  for (const key in map) {
    const item = {};
    item[valueField] = key;
    item[labelField] = map[key];
    list.push(item);
  }
  return list;
};


module.exports = {
  ORG_MAP,
  INDUSTRY_MAP,
  map2List,
  RECEIVER_LIST,
};
